﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 装饰模式
{
    /// <summary>
    /// 装饰抽象类,要让装饰完全取代抽象组件，所以必须继承自Photo
    /// </summary>
    abstract class Decorator:Phone
    {
        private readonly Phone _phone;

        protected Decorator(Phone phone)
        {
            _phone = phone;
        }

        public override void Print()
        {
            if (_phone != null)
            {
                _phone.Print();
            }
        }
    }
}
